package com.boge.modules.house.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.boge.common.utils.PageUtils;
import com.boge.common.utils.Query;

import com.boge.modules.house.dao.TAreaDao;
import com.boge.modules.house.entity.TAreaEntity;
import com.boge.modules.house.service.TAreaService;


@Service("tAreaService")
public class TAreaServiceImpl extends ServiceImpl<TAreaDao, TAreaEntity> implements TAreaService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TAreaEntity> page = this.page(
                new Query<TAreaEntity>().getPage(params),
                new QueryWrapper<TAreaEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<TAreaEntity> listByCityCode(String cityCode) {

        return this.list(new LambdaQueryWrapper<TAreaEntity>().eq(TAreaEntity::getCityCode,cityCode));
    }

}